package com.iengine.services.api.command;

import java.util.Map;

/**
 * @author rtygbwwwerr
 */
public abstract class AbstractWebApiCommand extends AbstractApiCommand {

    private String mName;
    private String mUrl;
    private String mSummary;
    
    /**
     * 构造函数
     */
    public AbstractWebApiCommand() {
    	
    }
    
    /**
     * @param name 标题
     * @param url 网页url
     * @param summary 摘要
     */
    public AbstractWebApiCommand(String name, String url, String summary) {
        mName = name;
        mUrl = url;
        mSummary = summary;
    }
    
    
    /**
     * @param result 语义解析结果
     * @return 命令中文名称
     */
    protected String getName(Map map) {
        return mName;
    }
    
    /**
     * @param result 语义解析结果
     * @return 返回功能展现页面url
     */
    protected String getUrl(Map map) {
        return mUrl;
    }
    
    /**
     * @param result 语义解析结果
     * @return 返回summary
     */
    protected String getSummary(Map map) {
        return mSummary;
    }
    
    
    @Override
    protected Map getFormatResult(Map map) {
        
        final String name = getName(map);
        final String url = getUrl(map);
        
        return map;
    }
    
}
